package com.action;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

import com.model.ShardTestBean;
import com.service.ShardStrategyService;

/**
 * 
 * Function: 增加信息记录
 * 
 * Project Name:DepotsTableDemo 
 * Package Name:com.action 
 * File Name:ShardTestAction.java 
 * ClassName: ShardTestAction  
 * 
 * @author tankaichao 
 * @email cgztkc@126.com 
 * @Date 2017年1月5日下午4:48:01
 * @since JDK 1.8 
 *
 */
@Controller
@RequestMapping("shardTest")
public class ShardTestAction {
	private static Logger log = Logger.getLogger(ShardTestAction.class);

	@Autowired
	private ShardStrategyService shardStrategyService;

	@RequestMapping(value = "/",method = RequestMethod.POST)
	public ModelAndView add(ShardTestBean shardTestBean) {
		ModelAndView mv = new ModelAndView();
		shardStrategyService.add(shardTestBean);
		mv.addObject("shardTestBean", shardTestBean);
		mv.setViewName("shardtestedit");
		log.info("添加用户信息成功 post");
		return mv;
	}
	
}
